﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Ecosystème
{
    public partial class AjoutEspece : Form
    {
        String cheminXML = "C:\\Users\\adrien\\Desktop\\listeEtreVivant.xml";

        public AjoutEspece()
        {
            InitializeComponent();
            dgvAjoutEspece.Rows.Add("Attaque");
            dgvAjoutEspece.Rows.Add("Esquive");
            dgvAjoutEspece.Rows.Add("Dégats");
            dgvAjoutEspece.Rows.Add("Vie max");
            dgvAjoutEspece.Rows.Add("Régénération");
            dgvAjoutEspece.Rows.Add("Faim max");
            dgvAjoutEspece.Rows.Add("Soif max");
            dgvAjoutEspece.Rows.Add("Vue");

            Arborescence arbre = new Arborescence(cheminXML, tvAjoutEspece);
        }

        private void btnChargerImage_Click(object sender, EventArgs e)
        {
            OpenFileDialog browseFile = new OpenFileDialog();
            browseFile.Title = "Choisissez l'image";
            if (browseFile.ShowDialog() == DialogResult.Cancel)
                return;
            try
            {
                Bitmap img = new Bitmap(@browseFile.FileName);
                Bitmap img2 = new Bitmap(img, new Size(139, 128));

                pbEtreVivant.Image = img2;
            }
            catch (Exception)
            {
                MessageBox.Show("Error opening file", "File Error",
                MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }

        private void btnRetour_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnValider_Click(object sender, EventArgs e)
        {

        }

    }
}
